/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.lucava.boatskeeper.server.handler.boat;

import net.customware.gwt.dispatch.server.ActionHandler;
import net.customware.gwt.dispatch.server.ExecutionContext;
import net.customware.gwt.dispatch.shared.ActionException;
import org.lucava.boatskeeper.server.MockBoatDao;
import org.lucava.boatskeeper.shared.rpc.boat.GetBoat;
import org.lucava.boatskeeper.shared.rpc.boat.GetBoatResult;

/**
 *
 * @author glenn
 */
public class GetBoatHandler implements ActionHandler<GetBoat, GetBoatResult> {

    @Override
    public Class<GetBoat> getActionType() {
        return GetBoat.class;
    }

    @Override
    public GetBoatResult execute(GetBoat a, ExecutionContext ec) throws ActionException {
        
        
        GetBoatResult getBoatResult = new GetBoatResult(MockBoatDao.get(a.getId()));
        return getBoatResult;
    }

    @Override
    public void rollback(GetBoat a, GetBoatResult r, ExecutionContext ec) throws ActionException {
    }
}
